#pragma once
#include "stdafx.h"
#include "../sgp/Rect.h"

namespace ja2{ namespace sgp
{
	Rect::Rect(std::uint16_t Left, std::uint16_t Top, std::uint16_t Right, std::uint16_t Bottom)
		: m_Left(Left), m_Top(Top), m_Right(Right), m_Bottom(Bottom)
	{
	}

	Rect::operator RECT() const
	{
		RECT rect = {m_Left, m_Top, m_Right, m_Bottom};
		
		return rect;
	}

	std::uint_least16_t Rect::height() const
	{
		return (bottom() - top());
	}

	std::uint_least16_t Rect::width() const
	{
		return (right() - left());
	}

	bool Rect::empty() const
	{
		return (m_Left == 0 &&  m_Top == 0 && m_Right == 0 && m_Bottom == 0);
	}

	void Rect::set_left(std::uint16_t Value)
	{
		m_Left = Value;
	}

	void Rect::set_right(std::uint16_t Value)
	{
		m_Right = Value;
	}

	void Rect::set_top(std::uint16_t Top)
	{
		m_Top = Top;
	}

	void Rect::set_bottom(std::uint16_t Value)
	{
		m_Bottom = Value;
	}
} /*sgp*/} /*ja2*/